<?php
$_doc = array();
$_doc['title'] = L('tab_role_add');
$_doc['extra'] = '<link rel="stylesheet" type="text/css" href="'.__CURRENT__.'/pRole.css" />';
L(include(LANG_PATH.LANG_SET.'/pUser.php'));
?>
<include file="pAdmin:header" />
<table class="tabmenu" cellspacing="0">
    <tbody>
        <tr>
            <td class="wedge">&nbsp;</td>
            <td class="wmenu"><a href="__APP__/pUser/index">{%tab_user_list}</a></td>
            <td class="wmenu"><a href="__APP__/pUser/add"><span>{%tab_user_add}</span></a></td>
            <td class="wmenu"><a href="__URL__/index"><span>{%tab_role_list}</span></a></td>
            <td class="wmenu here"><a href="__URL__/add"><span>{%tab_role_add}</span></a></td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>
<div class="main">
    <ul class="fnc">
        <li>
            <button type="button" class="btn primary" onclick="act('save')">{%action_save}</button>
        </li>
    </ul>
    <form id="ipsForm" class="validateform" name="mainForm" method="post" action="__URL__">
        <input type="hidden" name="a"/>
        <table class="ips">
            <tbody>
                <tr>
                    <th class="essential"><label for="pk1">{%column_rolename}</label></th>
                    <td>
                        <input id="pk1" class="validate[required,rolename]" type="text" name="name" maxlength="32" size="40" />
                        <p class="hint">{%column_rolename_tip}</p>
                    </td>
                </tr>
                <tr>
                    <th><label>{%column_status}</label></th>
                    <td>
                        <p><input id="statusOn" type="radio" name="status" value="1" checked /><label for="statusOn" class="item">{%status_enabled}</label></p>
                        <p><input id="statusOff" type="radio" name="status" value="0" /><label for="statusOff" class="item">{%status_disabled}</label></p>
                    </td>
                </tr>
                <tr>
                    <th><label>{%column_purview}</label></th>
                    <td>
                        <div id="popelist">
                            <iterate name="popelist" id="bundle">
                                <ul class="popelist">
                                    <li class="ultitle">{$bundle.name}</li>
                                    <iterate name="bundle['sub']" id="pope">
                                    <li>
                                        <input type="checkbox" name="popedom[]" id="pope{$pope.id}" value="{$pope.id}"/>
                                        <label for="pope{$pope.id}">{$pope.name}</label>
                                    </li>
                                    </iterate>
                                </ul>
                            </iterate>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
    <ul class="fnc">
        <li><button type="button" class="btn primary" onclick="act('save')">{%action_save}</button></li>
    </ul>
</div>
<script type="text/javascript">
$(window).addEvent('domready',function(){
    $$('#popelist input').addEvent('click',function(){
       var label=this.getNext('label');
       if(this.getProperty('checked')) label.setStyle('background-color','#80DCF0');
       else label.setStyle('background-color','transparent');
   });
});
</script>
<include file="pAdmin:footer" />
